package main

import(
	"fmt"
	"gitee.com/lq8152/myspider/scheduler"
	"gitee.com/lq8152/myspider/page"
	"strings"
)

type MyPageProcesser struct {
}

func NewMyPageProcesser() *MyPageProcesser {
	return &MyPageProcesser{}
}



func (this *MyPageProcesser) Process(p *page.Page){
	if !p.IsSucc() {
		println(p.Errormsg)
		return
	}


	query := p.GetHtmlParser()
	name := query.Find("").Text()
	name = strings.Trim(name, " \t\n")

	summary := query.Find("").Text()
	summary = strings.Trim(summary, "\t\n")

	p.AddField("name", name)
	p.AddField("summary", summary)

}

func main(){

	var queue = scheduler.NewQueueScheduler(true)
	fmt.Println(queue == nil)
}